﻿@using Sausage.Web.Domain
@using Sausage.Web.DataModel
@model Sausage.Web.DataModel.ProjectJournal
@{
    ViewBag.Title = "查看工程日志";
    Layout = "~/Views/Shared/MainLayout.cshtml";
}
<h2>@ViewBag.Title</h2>
<br />
<div class="form-box">
    <table class="TableDetail">
        <tr>
            <th>
                所属单位
            </th>
            <td>
                @Html.DisplayFor(model => model.Organization.OrganizationName)
            </td>
        </tr>
        <tr>
            <th>
                项目名称
            </th>
            <td>
                @Html.ActionLink(Model.Project.ProjectName, "ViewProject", "Project", new { projectID = @Model.ProjectID }, new { @target = "_blank" })
            </td>
        </tr>
        <tr>
            <th>
                项目编号
            </th>
            <td>
                @Html.ActionLink(Model.Project.ProjectCode, "ViewProject", "Project", new { projectID = @Model.ProjectID }, new { @target = "_blank" })
            </td>
        </tr>
        <tr>
            <th>
                工程日志
            </th>
            <td>
                <div class="JournalContent">
                    @Html.Raw(Model.Content)
                </div>
            </td>
        </tr>
        <tr>
            <th>
                施工日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.ApplicationDate)
            </td>
        </tr>
        <tr>
            <th>
                天气
            </th>
            <td>
                @Html.DisplayFor(model => model.Weather)
            </td>
        </tr>
        <tr>
            <th>
                填报人
            </th>
            <td>
                @Html.DisplayFor(model => model.Applicant)
            </td>
        </tr>
        <tr>
            <th>
                填报日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.CreateDate)
            </td>
        </tr>
        <tr>
            <th>
                审核人
            </th>
            <td>
                @Html.DisplayFor(model => model.Auditor)
            </td>
        </tr>
        <tr>
            <th>
                审核日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.AuditedDate)
            </td>
        </tr>
        <tr>
            <th>
                签审人
            </th>
            <td>
                @Html.DisplayFor(model => model.Signer)
            </td>
        </tr>
        <tr>
            <th>
                签审日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.SignedDate)
            </td>
        </tr>
        <tr>
            <th>
                批准人
            </th>
            <td>
                @Html.DisplayFor(model => model.Approver)
            </td>
        </tr>
        <tr>
            <th>
                批准日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.ApprovedDate)
            </td>
        </tr>
        <tr>
            <th>
                备注
            </th>
            <td>
                @Html.DisplayFor(model => model.Memo)
            </td>
        </tr>
        <tr>
            <th>
                施工照片
            </th>
            <td>
                <ul class="PhotoList">
                    @{
                        foreach (ProjectPhoto photo in Model.ProjectPhoto)
                        {
                            //生成图片的地址
                            string url = Url.Action("Photo", "ProjectJournal", new { photoID = photo.PhotoID });

                            //生成链接
                        @Html.Raw("<li>");
                        @Html.Raw(string.Format("<a href=\"{0}\" target=\"_blank\">", url));
                        @Html.Raw(string.Format("<img class=\"Photo\" alt=\"{0}\" src=\"{1}\" title=\"{2}\" />", photo.PhotoName, url, photo.Memo));
                        @Html.Raw(string.Format("<span title=\"{0}\">{1}</span>", photo.Memo, photo.PhotoName));                                                                                                                                                          
                        @Html.Raw("</a>");
                        @Html.Raw("</li>");
                        }   
                    }
                </ul>
            </td>
        </tr>
    </table>
</div>
<br />
